<template>
    <div id="app">
        <router-view></router-view>
    </div>
</template>

<script>
export default {
    name: 'App',
    mounted() {
        window.addEventListener('unload', (e) => this.unloadHandler(e));
    },
    destroyed() {
        window.removeEventListener('unload', (e) => this.unloadHandler(e));
    },
    methods: {
        unloadHandler() {
            //如果是登录状态，关闭窗口前，移除用户
            this.$store.commit('closeBrowser');
        },
    },
};
</script>

<style lang="scss">
html,
body {
    margin: 0;
    padding: 0;
    min-width: 1700px;
    height: 100%;
    background: #f8f8f8;
}
* {
    margin: 0;
}
#app {
    height: 100%;
    p {
        margin: 0;
    }
}
</style>
